﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
using System.Xml.Linq;
using Sdo.Payment.Common;

namespace NWN.GDY.Web
{
    public class Global : System.Web.HttpApplication
    {
        protected void Application_Start(object sender, EventArgs e)
        {
            //System.Timers.Timer timer1 = new System.Timers.Timer();
            //timer1.Interval = 1000; // 50000 毫秒 = 50秒
            //timer1.Elapsed += new System.Timers.ElapsedEventHandler(timer1_Elapsed);
            //timer1.Start();
        }
        //void timer1_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        //{
        //    Log.Info("timer");
        //}

        protected void Session_Start(object sender, EventArgs e)
        {

        }

        protected void Application_BeginRequest(object sender, EventArgs e)
        {

        }

        protected void Application_AuthenticateRequest(object sender, EventArgs e)
        {

        }

        protected void Application_Error(object sender, EventArgs e)
        {
            Exception ex = Server.GetLastError();
            if (ex != null)
            {
                //记录日志
                Log.Error(ex);
                Server.ClearError();
                Response.Redirect("~/Error.aspx",true);
            }
            else
            {
                Log.Info("Application exception is null---");
            }
        }

        protected void Session_End(object sender, EventArgs e)
        {

        }

        protected void Application_End(object sender, EventArgs e)
        {

        }
    }
}